Repository navigation
feat(pnfs): implement the warm-standby metadata server - #767
Merged
Merged
Conversation
boddumanohar
force-pushed
the
impl/pnfs-mds-standby
branch
from
November 11, 2026 12:05
4c46862 to
ce4fbe7
Compare
boddumanohar
added a commit
to simplyblock/vela-os
that referenced
this pull request
Nov 11, 2026
Guest image side of the warm-standby metadata server (simplyblock/simplyblock-operator#767). A guest boots with no state disk and no nfsd; mds-agent fences the devices, mounts the state volume, sets the reservation key, and only then lets nfsd start. - Kernel patch 0025: nfsd.pnfs_mds_pr_key lets a metadata server instance register under a reservation key of its own and serve only the devices it holds. - Kernel patch 0024: xfs.pnfs_discarded_free_space skips zeroing free space for write layouts once discarded blocks read as zeros. - No state disk fstab entry; nfs-server, nfs-mountd, and nfsdcld wait for /run/mds/active, which mds-agent creates on promotion. - CI: only main and pnfs-minimal move the shared pnfsos tags; other branches push commit-pinned tags. Co-authored-by: Christoph Engelbert (noctarius) <me@noctarius.com>
boddumanohar
force-pushed
the
impl/pnfs-mds-standby
branch
2 times, most recently
from
November 11, 2026 12:32
5c7d5ee to
626c5ac
Compare
The pNFS metadata server runs as a StatefulSet of one active QEMU guest and spec.pnfs.mds.standbys warm standbys (default 1, at most 4), each on its own KVM node, so the loss of the active costs a promotion instead of a restart. - API: spec.pnfs.mds.standbys replaces stateSize and stateStorageClassName. Guests boot with no state disk, as standbys. - mds-agent serves MDSService (Describe, Promote), relayed by the runner. A promotion connects the state volume and every export, fences each device with an NVMe persistent reservation keyed by StatefulSet UID and epoch (register, then preempt-and-abort), mounts, and only then lets nfsd start. - The operator detects a lost active (pod deleted, or node and session gone for 20 s), writes the new active and epoch on the StatefulSet before acting, promotes the lowest-ordinal ready standby, repoints the Service, and demotes a returning old active. - The state coordinator keeps the state volume, each volume's allowed hosts, and the StatefulSet's scale; a scale-down moves the active to a lower ordinal first, and a template change rolls standbys before the active. - atlas-lib: nvmepr (persistent reservations), nvmepassthru, MDS reservation keys, and volume allowed-hosts calls on the control-plane client. - CI pins the MDS guest image built from vela-os#30 (revert before merge).
boddumanohar
force-pushed
the
impl/pnfs-mds-standby
branch
from
November 19, 2026 14:21
626c5ac to
518c67d
Compare
… health check finds it
boddumanohar
marked this pull request as ready for review
November 19, 2026 15:52
noctarius
reviewed
Nov 20, 2026
…mmands A general Run let any atlas-lib caller send an arbitrary NVMe command through the ioctl. The namespace ID and the Reservation Report are now unexported in nvmepr, its only user.
…the test doubles test The MDS StatefulSet's annotations and finalizer join the other storage.simplyblock.io keys in atlas-lib/kube. The in-memory doubles nvmepr/nvmeprtest and mdsstate/mdsstatetest become nvmepr/test and mdsstate/test.
mdsfailover.Ordinal and utils.MDSStatefulSetNameOfPod parsed the same <statefulset>-<ordinal> name with different checks: Ordinal read 1 from "-1" and 5 from "mds-+5", which the other refused. Both now go through utils.SplitMDSPodName, which returns the ordinal as an int32.
noctarius
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the warm-standby pNFS metadata server from
operator/docs/designs/design-pnfs-mds-standby.md(#741). Losing the active metadata server now costs a promotion of a standby that is already running, not a pod restart on another node.The guest image side is simplyblock/vela-os#30 (merged into
pnfs-minimal): guests boot as standbys with no state disk, and nfsd starts only after mds-agent has promoted the guest.Changes
API
spec.pnfs.mds.standbys(0 to 4, default 1): standby guests beside the active, each on its own KVM-capable node. It replacesstateSizeandstateStorageClassName. The chart passesdriver.pnfs.mds.standbysthrough.Workload (operator)
1 + standbyspods, one per KVM node, with no state disk in the pod.internal/mdsstate) keeps three things in line for each storage cluster:Takeover (operator,
internal/mdsfailover)Guest agent (CSI driver)
mds-agentservesMDSService(Describe, Promote) and the standard gRPC health check.mds-runnerrelays both and registers the guest as its pod.nfsd.pnfs_mds_pr_key./run/mds/active, which lets the nfsd units start.CreateExportis refused on a guest that is not active. A new export on the active guest is fenced before it is created.atlas-lib
nvmepr: NVMe persistent reservations on a namespace (register, reserve, preempt, preempt-and-abort, report), with an in-memory target (nvmeprtest) for tests.internal/nvmepassthru: the passthrough command shared bynvmeandnvmepr. A command the controller rejects is now returned as an error, where before it read as success.nfsexport: metadata server reservation keys (MDSReservationKey,ParseMDSKey,IsMDSKey).nfsexportrpc: theMDSServicewire contract.controlplane: add and remove a volume's allowed hosts.Test framework
sbtest: chaos restarts tell the active MDS apart from its standbys. The reservation detector treats every MDS-range key as the server's. The metadata workload pins pods by full node name.Testing
mdsfailover,mdsstate, the controller, the driver controller, the mds agent and relay, and atlas-libnvmepr,nvmepassthru, andnvme. The Linux-only packages ran in agolang:1.26.10container.make lint: 0 issues.make -C operator manifests generate,make helm-sync, andbuild-installerproduce no diff.standbys: 2, an RWX export, and fio with crc32c verification on two client nodes:standbyschanged 2 → 0 → 1 → 0 → 2: a scale-down with the active on ordinal 1 first moves it to ordinal 0.Takeover time
How long clients go without I/O when the metadata server is lost. A probe on each client node issued a 4 KiB
O_DSYNCwrite every 50 ms and logged every stall over 200 ms; node clocks were NTP-synced. Three runs per fault, compared with a single metadata server onmainon another cluster of the same shape.standbys: 2)main(single MDS)kill -9qemu)EACCESfor ~6 s after a delete,EIOafter a crashA deleted pod is promoted within 0.7–1.5 s. A crashed guest is promoted once its pod restarts and the guest reports the standby role, so its time follows the container restart and its back-off.